<?php
/**
 * ComProductsDetail.php class file.
 * @author wudg <544038230@qq.com>
 * @date 2020/10/27- 10:59 上午
 */
namespace common\models\com;

use common\models\base\ActiveRecord;
use Yii;

/**
 * This is the model class for table "com_products_detail".
 *
 * @property int $product_id 关联商品主表com_products.id
 * @property string|null $sku_img sku 图片信息，序列化存储
 * @property string|null $pics 商品主图信息，序列化存储
 * @property string|null $attr 商品属性信息，序列化存储
 * @property string $video 视频地址信息
 * @property string|null $extend_data 个平台特殊字段，序列化存储
 * @property string|null $detail_gallery 商品详情图,序列化存储
 * @property string|null $goods_desc 商品文字描叙
 * @property string|null $pc_desc 商品pc详情信息
 * @property string|null $m_desc 商品移动端详情信息
 */
class ComProductsDetail extends ActiveRecord
{
    /**
     * {@inheritdoc}
     */
    public static function tableName()
    {
        return 'com_products_detail';
    }


    /**
     * 指定product_id 为主键
     * @return array|string[]
     */
    public static function primaryKey()
    {
        return ['product_id'];
    }

    /**
     * {@inheritdoc}
     */
    public function rules()
    {
        return [
            [['product_id'], 'required'],
            [['product_id'], 'integer'],
            [['sku_img', 'pics', 'attr', 'extend_data', 'pc_desc', 'm_desc','detail_gallery'], 'string'],
            [['video','goods_desc'], 'string', 'max' => 500],
            [['product_id'], 'unique'],
        ];
    }

    /**
     * {@inheritdoc}
     */
    public function attributeLabels()
    {
        return [
            'product_id' => '关联商品主表com_products.id',
            'sku_img' => 'sku 图片信息',
            'pics' => '商品主图信息',
            'detail_gallery' => '商品详情图',
            'goods_desc' => '商品文字描叙',
            'attr' => '商品属性信息',
            'video' => '视频地址信息',
            'extend_data' => '个平台特殊字段',
            'pc_desc' => '商品pc详情信息',
            'm_desc' => '商品移动端详情信息',
        ];
    }
}